import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/parkPort/list',
    method: 'post',
    data: query
  })
}

export function parkPortDetail(id) {
  return request({
    url: '/parkPort/' + id,
    method: 'get',
  })
}

export function deleteParkPort(query) {
  return request({
    url: '/parkPort/deleteParkPort',
    method: 'post',
    data: query
  })
}

export function createParkPort(query) {
  return request({
    url: '/parkPort/createParkPort',
    method: 'post',
    data: query
  })
}

export function updateParkPort(query) {
  return request({
    url: '/parkPort/updateParkPort',
    method: 'post',
    data: query
  })
}

export function openRail(query) {
  return request({
    url: '/parkPort/openRail',
    method: 'post',
    data: query
  })
}

export function parkPortRailOpen(portId) {
  return request({
    url: `/parkPort/rail/open/${portId}`,
    method: 'get'
  })
}

//开闸
export function openGate(data) {
  return request({
    url: '/parkPort/rail/open',
    method: 'post',
    data
  })
}

//出入口截图
export function printScreen(portId) {
  return request({
    url: `/parkPort/rail/printScreen/${portId}`,
    method: 'get',
  })
}

//获取道闸最近识别的车牌
export function railPlateNumber(portId) {
  return request({
    url: `/auth/rail/plateNumber/${portId}`,
    method: 'get',
  })
}
